<template>
    <div>
        <el-container>
            <!-- 头部 -->
            <el-header>XXXXX大型后台管理系统
                <div>
                    <!-- <span></span>
                    <el-button type="danger" size="mini" >退出登录</el-button> -->
                    <el-dropdown @command="logout">
                        <span class="el-dropdown-link">
                            欢迎vvvip:{{ $store.getters.getUser.username }}<i class="el-icon-arrow-down el-icon--right"></i>
                        </span>
                        <el-dropdown-menu >
                            <el-dropdown-item >
                                退出登录
                            </el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
            </el-header>
            <el-container>
                <!-- 侧边 -->
                <el-aside width="200px">
                    <v-nav></v-nav>
                </el-aside>
                <!-- 主体内容 -->
                <el-main>
                    <!-- 二级路由出口 -->
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>
<script>
import vNav from '../components/vNav'
export default {
    data() {
        return {}
    },
    methods: {
        // 退出登录
        logout() {
            this.$store.dispatch('changeuserInfo', false)
            this.$router.push('/login')
        }
    },
    mounted() {

    },
    components: { vNav }
}
</script>
<style lang="less" scoped>
.el-header {
    background: rgb(20, 40, 50);
    text-align: center;
    height: 60px;
    line-height: 60px;
    color: #fff;
}

.el-header div {
    float: right;

    span {
        color: #fff;
        margin-right: 20px;
    }
}
</style>